<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" name="viewport" />
    <title>Title</title>
</head>
<body style="background-color: #cccccc">
    <form action="index.html">
        <input type="text" id="userName" name="userName" placeholder="用户名" value="123">
        <input type="text" id="password" name="password" placeholder="密码" value="456">
        <input type="submit" value="提交" />
    </form>
<script>
    function getval() {
        var result = {};
        result['userName'] = document.getElementById("userName").value;
        result['password'] = document.getElementById("password").value;
        return result;
    }
</script>
</body>
</html>